jQuery.fn.serializeObject   A
last analyzed

Complexity

Conditions 1
Paths 32

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
nc 32
nop 0
dl 0
loc 21
rs 9.3142

1 Function

Rating   Name   Duplication   Size   Complexity  
B 0 15 7
1
jQuery.fn.serializeObject = function()
2
{
3
    var o = {};
4
    var a = this.serializeArray();
5
    jQuery.each(a, function() {
6
        var value;
7
        if (o[this.name] !== undefined) {
8
            if (!o[this.name].push) {
9
                o[this.name] = [o[this.name]];
10
            }
11
            value = (this.value === 'on') ? true : this.value;
12
            value = (value === 'off') ? false : value;
13
            o[this.name].push(value || '');
14
        } else {
15
            value = (this.value === 'on') ? true : this.value;
16
            value = (value === 'off') ? false : value;
17
            o[this.name] = value;
18
        }
19
    });
20
    return o;
21
};
22